package com.wewins.fota.bean.bo.filter;

import lombok.Data;

import java.util.List;

@Data
public class LogFilterCond implements FilterCond {
    private String imei;

    private String product;

    private String srcV;

    private String dstV;

    private List<Long> createRange;

    private List<Long> updateRange;

    private int operator = -1;

    private int auto = -1;

    private String userIp;

    public Long getMinCreateTime() {
        if (createRange == null || createRange.size() != 2) {
            return 0L;
        }
        return createRange.get(0);
    }

    public Long getMaxCreateTime() {
        if (createRange == null || createRange.size() != 2) {
            return 0L;
        }
        return createRange.get(1);
    }

    public Long getMinUpdateTime() {
        if (updateRange == null || updateRange.size() != 2) {
            return 0L;
        }
        return updateRange.get(0);
    }

    public Long getMaxUpdateTime() {
        if (updateRange == null || updateRange.size() != 2) {
            return 0L;
        }
        return updateRange.get(1);
    }
}
